//
//阴阳历转换
//By Einstein 1999-4-12
//

/**
 * 快捷日历的最小年份
 * @type {number}
 */
const SIMPLE_MIN_YEAR = 1900;
/**
 * 快捷日历的最大年份
 * @type {number}
 */
const SIMPLE_MAX_YEAR = 2049;
/**
 * 历元年
 * @type {number}
 */
const EPOCH_YEAR=1201;
/**
 * 快捷日历的跨年数
 * @type {number}
 */
const INDEX_YEAR_COUNT=150;
/**
 * 阴历每年最大月数
 * @type {number}
 */
const MAX_LUNAR_MONTHS=13;
var title;
var y,m,d;
/**
 * 全局日历公共对象
 * @type {Object}
 */
var simpleLunarVars = new Object();
/**
 * 排盘设置
 * @type {Object}
 */
simpleLunarVars.setting = new Object();
simpleLunarVars.jieAlert = false;
/*----------------------------------------------------------*/
/**
 * 是否为夏令时
 * @return {boolean}
 */
Date.prototype.isDST = function () {
    // Generate test dates
    var Jan1 = new Date(this.getFullYear(), 0);
    var Jul1 = new Date(this.getFullYear(), 6);
    // DST in the Northern hemisphere is "fall back"
    if (Jan1.getTimezoneOffset() > Jul1.getTimezoneOffset() && this.getTimezoneOffset() != Jan1.getTimezoneOffset()) {
        return true;
    };
    // DST in Southern hemisphere is "leap ahead"
    if (Jan1.getTimezoneOffset() < Jul1.getTimezoneOffset() && this.getTimezoneOffset() != Jul1.getTimezoneOffset()) {
        return true;
    };
    // We're not in DST
    return false;
};
function make_array() {
  let tmparg=make_array.arguments;
  for(let i=0;i<tmparg.length;i++) {
    this[i]=tmparg[i];
  }
  this.length=tmparg.length;
}

function make_n_array(num) {
  for(let i=0;i<num;i++) {
    this[i]=i;
  }
  this.length=num;
}
function addScript(url){
    let script = document.createElement('script');
    script.setAttribute('type','text/javascript');
    script.setAttribute('src',url);
    document.getElementsByTagName('head')[0].appendChild(script);
}

function MyDate(y=0,m=0,d=0,h=0,w=0,l=0){//year,month,day,hour,week,leap
  this.y=y;
  this.m=m;
  this.d=d;
  this.h=h;
  this.w=w;
  this.l=l;
}
/**
 * 农历月数据,每月大小,闰月信息
 *                 b bbbbbbbbbbbb bbbb
 *        bit#     1 111111000000 0000
 *                 6 543210987654 3210
 *                 . ............ ....
 *        month#     000000000111
 *                 M 123456789012   L
 *
 *     b_j = 1 for long month, b_j = 0 for short month
 *     L is the leap month of the year if 1<=L<=12; NO leap month if L = 0.
 *     The leap month (if exists) is long one iff M = 1.
 * @type {make_array}
 */
simpleLunarVars.yearInfo=new make_array(
                                        0x04bd8,        /* 1900 */
    0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950,        /* 1905 */
    0x16554, 0x056a0, 0x09ad0, 0x055d2, 0x04ae0,        /* 1910 */
    0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540,        /* 1915 */
    0x0d6a0, 0x0ada2, 0x095b0, 0x14977, 0x04970,        /* 1920 */
    0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54,        /* 1925 */
    0x02b60, 0x09570, 0x052f2, 0x04970, 0x06566,        /* 1930 */
    0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60,        /* 1935 */
    0x186e3, 0x092e0, 0x1c8d7, 0x0c950, 0x0d4a0,        /* 1940 */
    0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0,        /* 1945 */
    0x092d0, 0x0d2b2, 0x0a950, 0x0b557, 0x06ca0,        /* 1950 */
    0x0b550, 0x15355, 0x04da0, 0x0a5d0, 0x14573,        /* 1955 */
    0x052d0, 0x0a9a8, 0x0e950, 0x06aa0, 0x0aea6,        /* 1960 */
    0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260,        /* 1965 */
    0x0f263, 0x0d950, 0x05b57, 0x056a0, 0x096d0,        /* 1970 */
    0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250,        /* 1975 */
    0x0d558, 0x0b540, 0x0b5a0, 0x195a6, 0x095b0,        /* 1980 */
    0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50,        /* 1985 */
    0x06d40, 0x0af46, 0x0ab60, 0x09570, 0x04af5,        /* 1990 */
    0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58,        /* 1995 */
    0x055c0, 0x0ab60, 0x096d5, 0x092e0, 0x0c960,        /* 2000 */
    0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0,        /* 2005 */
    0x0abb7, 0x025d0, 0x092d0, 0x0cab5, 0x0a950,        /* 2010 */
    0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0,        /* 2015 */
    0x0a5b0, 0x15176, 0x052b0, 0x0a930, 0x07954,        /* 2020 */
    0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6,        /* 2025 */
    0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, 0x05aa0,        /* 2030 */
    0x076a3, 0x096d0, 0x04bd7, 0x04ad0, 0x0a4d0,        /* 2035 */
    0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, 0x0b5a0,        /* 2040 */
    0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0,        /* 2045 */
    0x0aa50, 0x1b255, 0x06d20, 0x0ada0                  /* 2049 */
);
/**
 * 每个月(从寅到丑)月节的阳历起始日期
 * @type {Array}
 */
simpleLunarVars.fest = new make_array(
    /*月:寅	卯	辰	巳	午	未	申	酉	戌	亥	子	丑*/
    4.57744212962963,	6.34851851851852,	5.57825231481482,	6.33,	6.52702546296296,	7.96537037037037,	8.36844907407407,	8.46988425925926,	9.09246527777778,	8.19425925925926,	7.87210648148148,	6.32873842592593,/*1900*/
    4.81935185185185,	6.5908912037037,	5.82246527777778,	6.57666666666667,	6.7753125,	8.21358796296296,	8.61534722222222,	8.71545138888889,	9.33782407407407,	8.44061342592593,	8.11987268518518,	6.57746527777778,/*1901*/
    5.0681712962963,	6.83856481481482,	6.06766203703704,	6.81861111111111,	7.01373842592593,	8.44883101851852,	8.8487962962963,	8.94890046296296,	9.57303240740741,	8.67900462962963,	8.36181712962963,	6.82202546296296,/*1902*/
    5.3133912037037,	7.0825462962963,	6.3096412037037,	7.05928240740741,	7.25494212962963,	8.69208333333333,	9.0943287037037,	9.19607638888889,	9.82064814814815,	8.92596064814815,	8.6078587962963,	7.06738425925926,/*1903*/
    5.55841435185185,	6.32753472222222,	5.55475694444445,	6.30456018518519,	6.5006712962963,	7.93866898148148,	8.3415625,	8.44303240740741,	9.06636574074074,	8.17011574074074,	7.85092592592593,	6.31048611111111,/*1904*/
    4.80265046296296,	6.57333333333333,	5.80171296296296,	6.55143518518519,	6.74552083333333,	8.18054398148148,	8.58121527777778,	8.68178240740741,	9.30527777777778,	8.40956018518519,	8.09082175925926,	6.55100694444444,/*1905*/
    5.044375,	6.81673611111111,	6.04671296296296,	6.79755787037037,	6.99229166666667,	8.42726851851852,	8.82747685185185,	8.92791666666667,	9.55200231481482,	8.65756944444444,	8.33987268518519,	6.79959490740741,/*1906*/
    5.29084490740741,	7.06047453703704,	6.28804398148148,	7.03721064814815,	7.2312037037037,	8.66608796296296,	9.06664351851852,	9.16807870370371,	9.79354166666667,	8.90019675925926,	8.58293981481481,	7.04244212962963,/*1907*/
    5.53278935185185,	6.30108796296296,	5.52761574074074,	6.27662037037037,	6.4715625,	7.90833333333333,	8.31020833333333,	8.4112962962963,	9.0353125,	8.14028935185185,	7.82195601851852,	6.28140046296296,/*1908*/
    4.77258101851852,	6.54221064814815,	5.77042824074074,	6.52141203703704,	6.71800925925926,	8.15552083333333,	8.55726851851852,	8.65734953703704,	9.2799537037037,	8.3840625,	8.06584490740741,	6.52635416666667,/*1909*/
    5.01900462962963,	6.78923611111111,	6.01591435185185,	6.76342592592593,	6.95578703703704,	8.38960648148148,	8.78967592592593,	8.89039351851852,	9.5146412037037,	8.62040509259259,	8.3033912037037,	6.76449074074074,/*1910*/
    5.25712962962963,	7.02696759259259,	6.25314814814815,	7.00020833333333,	7.19296296296296,	8.62841435185185,	9.03084490740741,	9.13421296296296,	9.76037037037037,	8.86597222222222,	8.5469212962963,	7.00519675925926,/*1911*/
    5.49549768518519,	6.26457175925926,	5.49184027777778,	6.24100694444444,	6.43575231481482,	7.87270833333333,	8.27581018518518,	8.37892361111111,	9.00465277777778,	8.11016203703704,	7.7908912037037,	6.24854166666667,/*1912*/
    4.73793981481482,	6.50622685185185,	5.73322916666667,	6.48239583333333,	6.67597222222222,	8.11032407407407,	8.51096064814815,	8.61277777777778,	9.23865740740741,	8.345625,	8.0284837962963,	6.48809027777778,/*1913*/
    4.97865740740741,	6.74708333333333,	5.97349537037037,	6.72225694444444,	6.91662037037037,	8.35222222222222,	8.75359953703704,	8.85585648148148,	9.48248842592593,	8.5909837962963,	8.27575231481482,	6.7362962962963,/*1914*/
    5.22599537037037,	6.99185185185185,	6.21475694444444,	6.96023148148148,	7.1528587962963,	8.58871527777778,	8.99144675925926,	9.09519675925926,	9.72282407407407,	8.83168981481482,	8.51658564814815,	6.97762731481482,/*1915*/
    5.46803240740741,	6.23427083333333,	5.45681712962963,	6.20121527777778,	6.3928125,	7.82885416666667,	8.23258101851852,	8.33679398148148,	8.96378472222222,	8.07100694444445,	7.75427083333333,	6.21489583333333,/*1916*/
    4.70662037037037,	6.47555555555556,	5.70131944444445,	6.44840277777778,	6.64108796296296,	8.07653935185185,	8.47924768518518,	8.58288194444445,	9.20981481481481,	8.31729166666667,	8.00068287037037,	6.46137731481482,/*1917*/
    4.95353009259259,	6.7228587962963,	5.94805555555556,	6.69318287037037,	6.88260416666667,	8.31396990740741,	8.71347222222222,	8.81627314814815,	9.4446412037037,	8.55476851851852,	8.24061342592593,	6.70240740740741,/*1918*/
    5.1940162037037,	6.9621412037037,	6.18662037037037,	6.93194444444445,	7.12263888888889,	8.55590277777778,	8.95695601851852,	9.06084490740741,	9.68981481481482,	8.79965277777778,	8.48457175925926,	6.94498842592593,/*1919*/
    5.43502314814815,	6.20210648148148,	5.42701388888889,	6.17450231481482,	6.36831018518519,	7.80458333333333,	8.20710648148148,	8.31009259259259,	8.93689814814815,	8.04506944444444,	7.72935185185185,	6.1900462962963,/*1920*/
    4.68069444444445,	6.44802083333333,	5.67269675925926,	6.4196412037037,	6.61209490740741,	8.04622685185185,	8.44681712962963,	8.54836805555556,	9.17402777777778,	8.28159722222222,	7.96626157407407,	6.42841435185185,/*1921*/
    4.92111111111111,	6.69015046296296,	5.91527777777778,	6.66168981481482,	6.85434027777778,	8.28987268518519,	8.6924537037037,	8.79605324074074,	9.42320601851852,	8.53138888888889,	8.21571759259259,	6.67638888888889,/*1922*/
    5.16686342592593,	6.93363425925926,	6.15679398148148,	6.90155092592593,	7.09326388888889,	8.52929398148148,	8.93366898148148,	9.0396875,	9.66900462962963,	8.77800925925926,	8.46149305555556,	6.92052083333333,/*1923*/
    5.40939814814815,	6.17513888888889,	5.39799768518519,	6.1428125,	6.33438657407407,	7.77041666666667,	8.17516203703704,	8.28159722222222,	8.91121527777778,	8.0202662037037,	7.70346064814815,	6.16196759259259,/*1924*/
    4.65052083333333,	6.41655092592593,	5.64059027777778,	6.38739583333333,	6.58081018518519,	8.01729166666667,	8.42158564814815,	8.52778935185185,	9.15789351851852,	8.26820601851852,	7.95297453703704,	6.41269675925926,/*1925*/
    4.90157407407407,	6.66644675925926,	5.88769675925926,	6.63078703703704,	6.82056712962963,	8.25388888888889,	8.65569444444444,	8.76100694444444,	9.39225694444444,	8.50534722222222,	8.19350694444444,	6.6559837962963,/*1926*/
    5.14585648148148,	6.90990740740741,	6.12923611111111,	6.87018518518519,	7.05885416666667,	8.49299768518519,	8.89679398148148,	9.00376157407407,	9.63547453703704,	8.74784722222222,	8.43493055555556,	6.89665509259259,/*1927*/
    5.38636574074074,	6.15085648148148,	5.37119212962963,	6.11353009259259,	6.30357638888889,	7.7390625,	8.14409722222222,	8.25121527777778,	8.88184027777778,	7.99270833333333,	7.67865740740741,	6.14028935185185,/*1928*/
    4.63105324074074,	6.3971875,	5.61890046296296,	6.36134259259259,	6.54915509259259,	7.98030092592593,	8.38103009259259,	8.48581018518519,	9.11599537037037,	8.22739583333333,	7.91416666666667,	6.37675925925926,/*1929*/
    4.86883101851852,	6.63649305555556,	5.85928240740741,	6.60207175925926,	6.79030092592593,	8.22199074074074,	8.62289351851852,	8.72803240740741,	9.35935185185185,	8.47236111111111,	8.16015046296296,	6.62193287037037,/*1930*/
    5.11155092592593,	6.87645833333333,	6.09752314814815,	6.83998842592593,	7.02899305555556,	8.46219907407407,	8.86449074074074,	8.9703125,	9.60197916666667,	8.71517361111111,	8.40295138888889,	6.86461805555556,/*1931*/
    5.3537037037037,	6.11758101851852,	5.33771990740741,	6.0799537037037,	6.26924768518519,	7.70295138888889,	8.10541666666667,	8.21032407407408,	8.84002314814815,	7.95115740740741,	7.63775462962963,	6.09953703703704,/*1932*/
    4.58976851851852,	6.35513888888889,	5.57672453703704,	6.32065972222222,	6.51202546296296,	7.94741898148148,	8.35104166666667,	8.45655092592593,	9.08603009259259,	8.19650462962963,	7.88269675925926,	6.34475694444444,/*1933*/
    4.83584490740741,	6.60162037037037,	5.82197916666667,	6.56300925925926,	6.7509375,	8.18362268518519,	8.58585648148148,	8.69175925925926,	9.32290509259259,	8.43519675925926,	8.12258101851852,	6.58494212962963,/*1934*/
    5.07547453703704,	6.84039351851852,	6.05996527777778,	6.80002314814815,	6.98721064814815,	8.42050925925926,	8.82486111111111,	8.93337962962963,	9.56643518518519,	8.67883101851852,	8.36446759259259,	6.82403935185185,/*1935*/
    5.31199074074074,	6.07576388888889,	5.29634259259259,	6.03923611111111,	6.22962962962963,	7.66548611111111,	8.07164351851852,	8.18096064814815,	8.81417824074074,	7.9268287037037,	7.61265046296296,	6.07203703703704,/*1936*/
    4.55940972222222,	6.3225,	5.54261574074074,	6.28512731481482,	6.47416666666667,	7.90688657407407,	8.30925925925926,	8.41623842592593,	9.04923611111111,	8.16336805555556,	7.85157407407407,	6.31328703703704,/*1937*/
    4.80206018518519,	6.56511574074074,	5.78378472222222,	6.52440972222222,	6.71292824074074,	8.14677083333333,	8.55047453703704,	8.65842592592593,	9.29263888888889,	8.40855324074074,	8.09858796296296,	6.56100694444444,/*1938*/
    5.04891203703704,	6.80984953703704,	6.02597222222222,	6.76460648148148,	6.95252314814815,	8.38773148148148,	8.7940625,	8.90417824074074,	9.53930555555556,	8.65520833333333,	8.34513888888889,	6.80810185185185,/*1939*/
    5.29689814814815,	6.05831018518519,	5.27400462962963,	6.0112962962963,	6.19724537037037,	7.63056712962963,	8.03575231481482,	8.14530092592593,	8.77943287037037,	7.89358796296296,	7.58184027777778,	6.044375,/*1940*/
    4.53453703703704,	6.29865740740741,	5.51730324074074,	6.2568287037037,	6.44388888888889,	7.87712962962963,	8.28185185185185,	8.39152777777778,	9.02652777777778,	8.14170138888889,	7.83053240740741,	6.29326388888889,/*1941*/
    4.78372685185185,	6.54814814814815,	5.76655092592593,	6.50474537037037,	6.68924768518519,	8.11928240740741,	8.52104166666667,	8.62924768518518,	9.26506944444444,	8.38271990740741,	8.07415509259259,	6.5380787037037,/*1942*/
    5.02782407407407,	6.790625,	6.00775462962963,	6.74538194444445,	6.92982638888889,	8.36030092592593,	8.76284722222222,	8.87162037037037,	9.50728009259259,	8.6241087962963,	8.31446759259259,	6.77725694444445,/*1943*/
    5.26591435185185,	6.0280787037037,	5.24581018518519,	5.98591435185185,	6.17422453703704,	7.60835648148148,	8.01309027777778,	8.12189814814815,	8.75605324074074,	7.87128472222222,	7.56085648148148,	6.02391203703704,/*1944*/
    4.51344907407407,	6.27637731481482,	5.49428240740741,	6.23373842592593,	6.42041666666667,	7.8519212962963,	8.25350694444444,	8.35980324074074,	8.99244212962963,	8.10707175925926,	7.79697916666667,	6.26133101851852,/*1945*/
    4.75269675925926,	6.51710648148148,	5.73509259259259,	6.47325231481482,	6.65881944444444,	8.09083333333333,	8.49415509259259,	8.60237268518519,	9.23665509259259,	8.3521875,	8.04179398148148,	6.50439814814815,/*1946*/
    4.99329861111111,	6.75550925925926,	5.97231481481482,	6.71038194444445,	6.89666666666667,	8.33041666666667,	8.73670138888889,	8.84795138888889,	9.48422453703704,	8.60025462962963,	8.28901620370371,	6.75015046296296,/*1947*/
    5.2375,	5.99853009259259,	5.21481481481482,	5.95292824074074,	6.1391087962963,	7.57185185185185,	7.97658564814815,	8.08679398148148,	8.72240740740741,	7.83787037037037,	7.52612268518519,	5.98689814814815,/*1948*/
    4.47417824074074,	6.23560185185185,	5.45273148148148,	6.19206018518519,	6.3797337962963,	7.81359953703704,	8.21870370370371,	8.32927083333333,	8.96599537037037,	8.0831712962963,	7.77319444444444,	6.23521990740741,/*1949*/
    4.72275462962963,	6.48293981481482,	5.69753472222222,	6.43380787037037,	6.61875,	8.0508912037037,	8.45498842592593,	8.56503472222222,	9.20253472222222,	8.32202546296296,	8.0150462962963,	6.4794212962963,/*1950*/
    4.96766203703704,	6.72685185185185,	5.9393287037037,	6.67309027777778,	6.85592592592593,	8.28739583333333,	8.69266203703704,	8.80428240740741,	9.44193287037037,	8.56013888888889,	8.25159722222222,	6.71510416666667,/*1951*/
    5.20340277777778,	5.96340277777778,	5.17710648148148,	5.91251157407407,	6.09743055555556,	7.53099537037037,	7.93815972222222,	8.05118055555556,	8.68917824074074,	7.80664351851852,	7.49690972222222,	5.95974537037037,/*1952*/
    4.44853009259259,	6.21002314814815,	5.42541666666667,	6.16131944444444,	6.34449074074074,	7.77423611111111,	8.17679398148148,	8.2866087962963,	8.92390046296296,	8.04232638888889,	7.7340162037037,	6.19811342592593,/*1953*/
    4.68797453703704,	6.45037037037037,	5.66608796296296,	6.40150462962963,	6.58390046296296,	8.01331018518519,	8.41601851851852,	8.52628472222222,	9.16479166666667,	8.28511574074074,	7.97811342592593,	6.44157407407407,/*1954*/
    4.92888888888889,	6.68815972222222,	5.90189814814815,	6.63747685185185,	6.82181712962963,	8.25407407407407,	8.65974537037037,	8.77206018518518,	9.4112037037037,	8.53135416666667,	8.22414351851852,	6.68769675925926,/*1955*/
    5.17494212962963,	5.93364583333333,	5.14663194444444,	5.8819212962963,	6.0665162037037,	7.49859953703704,	7.90291666666667,	8.01314814814815,	8.64991898148148,	7.76798611111111,	7.45979166666667,	5.92390046296296,/*1956*/
    4.41292824074074,	6.17369212962963,	5.38806712962963,	6.12386574074074,	6.30883101851852,	7.74177083333333,	8.14725694444444,	8.25846064814815,	8.89581018518519,	8.01390046296296,	7.70550925925926,	6.16967592592593,/*1957*/
    4.65915509259259,	6.4200462962963,	5.63357638888889,	6.36747685185185,	6.55012731481482,	7.98153935185185,	8.3869212962963,	8.49917824074074,	9.13828703703704,	8.25825231481482,	7.95109953703704,	6.41548611111111,/*1958*/
    4.90428240740741,	6.66429398148148,	5.87710648148148,	6.61020833333333,	6.79170138888889,	8.22212962962963,	8.62782407407407,	8.74159722222222,	9.38180555555556,	8.50142361111111,	8.1925462962963,	6.65447916666667,/*1959*/
    5.14107638888889,	5.90006944444445,	5.11357638888889,	5.84899305555556,	6.03372685185185,	7.46711805555556,	7.87481481481482,	7.98983796296296,	8.63100694444445,	7.75140046296296,	7.44287037037037,	5.90458333333333,/*1960*/
    4.3905787037037,	6.1490625,	5.36258101851852,	6.09810185185185,	6.28194444444444,	7.71290509259259,	8.11688657407408,	8.22861111111111,	8.8687037037037,	7.99040509259259,	7.68465277777778,	6.14925925925926,/*1961*/
    4.63703703703704,	6.39547453703704,	5.60710648148148,	6.33990740740741,	6.52170138888889,	7.9521412037037,	8.35671296296296,	8.46898148148148,	9.1096412037037,	8.23256944444444,	7.92822916666667,	6.39335648148148,/*1962*/
    4.88037037037037,	6.63690972222222,	5.84628472222222,	6.57774305555556,	6.76002314814815,	8.19278935185185,	8.60097222222222,	8.71655092592593,	9.35849537037037,	8.48077546296296,	8.17541666666667,	6.64050925925926,/*1963*/
    5.12841435185185,	5.88609953703704,	5.09606481481482,	5.82709490740741,	6.00813657407407,	7.43896990740741,	7.84454861111111,	7.95793981481482,	8.59826388888889,	7.71881944444445,	7.41184027777778,	5.87635416666667,/*1964*/
    4.36534722222222,	6.12543981481482,	5.33799768518519,	6.07050925925926,	6.25145833333333,	7.68150462962963,	8.08652777777778,	8.19988425925926,	8.84105324074074,	7.96287037037037,	7.65662037037037,	6.12106481481482,/*1965*/
    4.60958333333333,	6.36899305555556,	5.5808912037037,	6.31280092592593,	6.49278935185185,	7.9215162037037,	8.32564814814815,	8.43890046296296,	9.08105324074074,	8.20503472222222,	7.90121527777778,	6.36688657407407,/*1966*/
    4.8547337962963,	6.61241898148148,	5.82269675925926,	6.55377314814815,	6.73354166666667,	8.16202546296296,	8.56586805555556,	8.67895833333333,	9.32026620370371,	8.44262731481482,	8.13712962962963,	6.60150462962963,/*1967*/
    5.08846064814815,	5.84565972222222,	5.05616898148148,	5.78873842592593,	5.97158564814815,	7.40390046296296,	7.81054398148148,	7.92458333333333,	8.56554398148148,	7.68700231481482,	7.38072916666667,	5.845,/*1968*/
    4.3325462962963,	6.0906712962963,	5.30197916666667,	6.03457175925926,	6.21630787037037,	7.64688657407407,	8.05145833333333,	8.1634837962963,	8.80324074074074,	7.92453703703704,	7.61895833333333,	6.08447916666667,/*1969*/
    4.57340277777778,	6.33225694444444,	5.54287037037037,	6.27346064814815,	6.45292824074074,	7.88230324074074,	8.28756944444444,	8.40130787037037,	9.04273148148148,	8.16508101851852,	7.85924768518519,	6.32298611111111,/*1970*/
    4.80931712962963,	6.56578703703704,	5.775,	6.50564814814815,	6.68670138888889,	8.11883101851852,	8.52791666666667,	8.64597222222222,	9.2906712962963,	8.41431712962963,	8.108125,	6.57071759259259,/*1971*/
    5.05570601851852,	5.81115740740741,	5.02002314814815,	5.75081018518519,	5.93193287037037,	7.36311342592593,	7.76978009259259,	7.88548611111111,	8.52899305555556,	7.65234953703704,	7.34631944444444,	5.80924768518519,/*1972*/
    4.29458333333333,	6.05041666666667,	5.2596412037037,	5.99054398148148,	6.17141203703704,	7.60232638888889,	8.00888888888889,	8.12458333333333,	8.76892361111111,	7.89418981481482,	7.59054398148148,	6.05549768518519,/*1973*/
    4.54172453703704,	6.29659722222222,	5.50347222222222,	6.23185185185185,	6.41086805555556,	7.84104166666667,	8.24803240740741,	8.36462962962963,	9.01017361111111,	8.13747685185185,	7.83653935185185,	6.30381944444444,/*1974*/
    4.79111111111111,	6.54568287037037,	5.75104166666667,	6.47721064814815,	6.65417824074074,	8.08291666666667,	8.48950231481482,	8.60644675925926,	9.25143518518519,	8.37680555555556,	8.07371527777778,	6.53983796296296,/*1975*/
    5.02740740740741,	5.78340277777778,	4.99059027777778,	5.71833333333333,	5.89667824074074,	7.32696759259259,	7.73496527777778,	7.85291666666667,	8.49864583333333,	7.62400462962963,	7.32009259259259,	5.78545138888889,/*1976*/
    4.27320601851852,	6.03065972222222,	5.24009259259259,	5.96944444444444,	6.1472337962963,	7.57490740740741,	7.9793287037037,	8.09422453703704,	8.73884259259259,	7.86515046296296,	7.56306712962963,	6.03,/*1977*/
    4.51871527777778,	6.2765162037037,	5.48564814814815,	6.21425925925926,	6.39103009259259,	7.81732638888889,	8.22060185185185,	8.335,	8.97979166666667,	8.10695601851852,	7.80556712962963,	6.27190972222222,/*1978*/
    4.75854166666667,	6.51363425925926,	5.72079861111111,	6.4494212962963,	6.62859953703704,	8.05876157407407,	8.4658912037037,	8.58315972222222,	9.22918981481482,	8.35609953703704,	8.05402777777778,	6.52005787037037,/*1979*/
    5.00657407407407,	5.76144675925926,	4.96854166666667,	5.6975462962963,	5.87759259259259,	7.30828703703704,	7.71423611111111,	7.82878472222222,	8.47168981481481,	7.5959837962963,	7.29253472222222,	5.75877314814815,/*1980*/
    4.24679398148148,	6.00355324074074,	5.2118287037037,	5.94082175925926,	6.11989583333333,	7.54990740740741,	7.95635416666667,	8.07167824074074,	8.71495370370371,	7.83922453703704,	7.53559027777778,	6.00179398148148,/*1981*/
    4.48990740740741,	6.24622685185185,	5.45325231481482,	6.18054398148148,	6.35825231481482,	7.78790509259259,	8.19565972222222,	8.31369212962963,	8.95982638888889,	8.08618055555556,	7.7833912037037,	6.24909722222222,/*1982*/
    4.73590277777778,	6.49111111111111,	5.69748842592593,	6.42420138888889,	6.60118055555556,	8.03001157407407,	8.4372337962963,	8.55559027777778,	9.20212962962963,	8.32791666666667,	8.02337962962963,	6.48670138888889,/*1983*/
    4.97134259259259,	5.72545138888889,	4.93217592592593,	5.66038194444444,	5.83931712962963,	7.27020833333333,	7.67908564814815,	7.79849537037037,	8.44623842592593,	7.57328703703704,	7.26947916666667,	5.73269675925926,/*1984*/
    4.2165162037037,	5.9696875,	5.17609953703704,	5.90453703703704,	6.08328703703704,	7.51290509259259,	7.91962962962963,	8.03681712962963,	8.68371527777778,	7.8121412037037,	7.51135416666667,	5.97780092592593,/*1985*/
    4.46368055555556,	6.21675925925926,	5.42091435185185,	6.14625,	6.32248842592593,	7.75052083333333,	8.15666666666667,	8.27403935185185,	8.92135416666667,	8.05056712962963,	7.75064814814815,	6.21736111111111,/*1986*/
    4.7025462962963,	6.45390046296296,	5.65564814814815,	6.37887731481482,	6.55483796296296,	7.98517361111111,	8.39528935185185,	8.51674768518519,	9.16643518518518,	8.29560185185185,	7.99458333333333,	6.46076388888889,/*1987*/
    4.94640046296296,	5.69898148148148,	4.90212962962963,	5.62619212962963,	5.80200231481482,	7.23118055555556,	7.6390625,	7.75799768518519,	8.40590277777778,	7.53396990740741,	7.23226851851852,	5.69855324074074,/*1988*/
    4.18552083333333,	5.94037037037037,	5.14576388888889,	5.87077546296296,	6.04528935185185,	7.47181712962963,	7.87768518518519,	7.99575231481482,	8.64396990740741,	7.77328703703704,	7.47288194444444,	5.93974537037037,/*1989*/
    4.42638888888889,	6.18006944444444,	5.38398148148148,	6.10793981481482,	6.28215277777778,	7.70865740740741,	8.1149537037037,	8.23435185185185,	8.88459490740741,	8.01631944444445,	7.7181712962963,	6.18619212962963,/*1990*/
    4.6725,	6.42517361111111,	5.62826388888889,	6.35200231481482,	6.52658564814815,	7.95346064814815,	8.35920138888889,	8.47732638888889,	9.12577546296296,	8.25543981481482,	7.95555555555556,	6.42258101851852,/*1991*/
    4.90853009259259,	5.6612037037037,	4.86467592592593,	5.58935185185185,	5.76549768518519,	7.19461805555556,	7.60236111111111,	7.72106481481482,	8.36908564814815,	7.49793981481482,	7.19736111111111,	5.66424768518519,/*1992*/
    4.15079861111111,	5.90453703703704,	5.10915509259259,	5.83452546296296,	6.01056712962963,	7.43891203703704,	7.84581018518519,	7.96373842592593,	8.61113425925926,	7.73996527777778,	7.44015046296296,	5.90841435185185,/*1993*/
    4.39648148148148,	6.15118055555556,	5.35541666666667,	6.07922453703704,	6.25337962962963,	7.68011574074074,	8.08636574074074,	8.20494212962963,	8.85353009259259,	7.98305555555556,	7.68255787037037,	6.14866898148148,/*1994*/
    4.63392361111111,	6.38615740740741,	5.58895833333333,	6.31253472222222,	6.48782407407407,	7.91736111111111,	8.32759259259259,	8.45039351851852,	9.10222222222222,	8.23304398148148,	7.93211805555556,	6.39684027777778,/*1995*/
    4.88048611111111,	5.63170138888889,	4.8347337962963,	5.55974537037037,	5.73665509259259,	7.16666666666667,	7.57556712962963,	7.69612268518519,	8.34631944444444,	7.47677083333333,	7.17638888888889,	5.64199074074074,/*1996*/
    4.12635416666667,	5.8778587962963,	5.08074074074074,	5.80516203703704,	5.98091435185185,	7.40929398148148,	7.816875,	7.93667824074074,	8.5869212962963,	7.71849537037037,	7.4200462962963,	5.88760416666667,/*1997*/
    4.37282407407407,	6.12309027777778,	5.32288194444444,	6.04386574074074,	6.21761574074074,	7.64612268518519,	8.05543981481482,	8.17771990740741,	8.83038194444445,	7.96415509259259,	7.6677662037037,	6.13690972222222,/*1998*/
    4.62295138888889,	6.37340277777778,	5.57265046296296,	6.29236111111111,	6.46466435185185,	7.89234953703704,	8.30145833333333,	8.42359953703704,	9.07524305555556,	8.20684027777778,	7.90795138888889,	6.37548611111111,/*1999*/
    4.86138888888889,	5.61296296296296,	4.81386574074074,	5.53483796296296,	5.70733796296296,	7.13467592592593,	7.54373842592593,	7.66608796296296,	8.31820601851852,	7.4500462962963,	7.15071759259259,	5.6175462962963,/*2000*/
    4.10334490740741,	5.85587962962963,	5.05858796296296,	5.78113425925926,	5.95387731481482,	7.37965277777778,	7.78635416666667,	7.90707175925926,	8.55903935185185,	7.69226851851852,	7.39505787037037,	5.86354166666667,/*2001*/
    4.35005787037037,	6.10246527777778,	5.30436342592593,	6.02590277777778,	6.19775462962963,	7.62234953703704,	8.02729166666667,	8.14655092592593,	8.798125,	7.93181712962963,	7.63488425925926,	6.10258101851852,/*2002*/
    4.58703703703704,	6.33671296296296,	5.53644675925926,	6.25728009259259,	6.4303587962963,	7.85809027777778,	8.266875,	8.38905092592593,	9.04204861111111,	8.17582175925926,	7.87857638888889,	6.34621527777778,/*2003*/
    4.83070601851852,	5.58030092592593,	4.78008101851852,	5.50171296296296,	5.67622685185185,	7.1050462962963,	7.51361111111111,	7.63396990740741,	8.28423611111111,	7.41565972222222,	7.11732638888889,	5.58540509259259,/*2004*/
    4.07155092592593,	5.82303240740741,	5.02380787037037,	5.74502314814815,	5.91796296296296,	7.34483796296296,	7.75232638888889,	7.87268518518519,	8.523125,	7.65446759259259,	7.35603009259259,	5.82427083333333,/*2005*/
    4.31060185185185,	6.06157407407407,	5.26077546296296,	5.97961805555556,	6.15068287037037,	7.57739583333333,	7.98665509259259,	8.11042824074074,	8.76484953703704,	7.89920138888889,	7.60195601851852,	6.06956018518519,/*2006*/
    4.55430555555556,	6.30415509259259,	5.50322916666667,	6.2225,	6.3937962962963,	7.82064814814815,	8.23003472222222,	8.35380787037037,	9.00797453703704,	8.14167824074074,	7.84311342592593,	6.30891203703704,/*2007*/
    4.79194444444445,	5.54083333333333,	4.74018518518519,	5.46071759259259,	5.63314814814815,	7.06028935185185,	7.46956018518519,	7.59314814814815,	8.24766203703704,	7.38233796296296,	7.08493055555556,	5.55148148148148,/*2008*/
    4.03458333333333,	5.78299768518519,	4.98179398148148,	5.70196759259259,	5.87435185185185,	7.30103009259259,	7.70913194444445,	7.83167824074074,	8.48615740740741,	7.62240740740741,	7.32793981481482,	5.7977662037037,/*2009*/
    4.28322916666667,	6.03219907407407,	5.22951388888889,	5.94724537037037,	6.11763888888889,	7.54332175925926,	7.95077546296296,	8.07269675925926,	8.72672453703704,	7.86284722222222,	7.56832175925926,	6.03792824074074,/*2010*/
    4.52287037037037,	6.27082175925926,	5.46665509259259,	6.18278935185185,	6.35231481481482,	7.77916666666667,	8.18988425925926,	8.31543981481481,	8.97159722222222,	8.10759259259259,	7.81180555555556,	6.28049768518519,/*2011*/
    4.76555555555556,	5.51461805555556,	4.7122337962963,	5.43033564814815,	5.60131944444444,	7.02827546296296,	7.43788194444444,	7.56181712962963,	8.21646990740741,	7.35135416666667,	7.05481481481482,	5.52335648148148,/*2012*/
    4.0093287037037,	5.7603125,	4.9600462962963,	5.67928240740741,	5.84953703703704,	7.27402777777778,	7.68081018518519,	7.80296296296296,	8.45729166666667,	7.59297453703704,	7.29759259259259,	5.76679398148148,/*2013*/
    4.25226851851852,	6.00157407407407,	5.19907407407407,	5.91627314814815,	6.08545138888889,	7.51025462962963,	7.91837962962963,	8.04266203703704,	8.69965277777778,	7.83796296296296,	7.54451388888889,	6.01427083333333,/*2014*/
    4.49893518518519,	6.24699074074074,	5.44384259259259,	6.16152777777778,	6.33207175925926,	7.75851851851852,	8.16765046296296,	8.29136574074074,	8.94640046296296,	8.08238425925926,	7.78704861111111,	6.25582175925926,/*2015*/
    4.7403125,	5.48857638888889,	4.68577546296296,	5.40408564814815,	5.57534722222222,	7.00232638888889,	7.41181712962963,	7.53547453703704,	8.18984953703704,	7.32478009259259,	7.02856481481482,	5.49706018518519,/*2016*/
    3.98199074074074,	5.73106481481482,	4.9287037037037,	5.6465625,	5.81709490740741,	7.24354166666667,	7.65280092592593,	7.7768287037037,	8.43204861111111,	7.56793981481482,	7.27268518518519,	5.7421875,/*2017*/
    4.228125,	5.97790509259259,	5.17554398148148,	5.89261574074074,	6.06190972222222,	7.48741898148148,	7.89628472222222,	8.020625,	8.67688657407407,	7.8137037037037,	7.51798611111111,	5.98539351851852,/*2018*/
    4.46828703703704,	6.21510416666667,	5.41072916666667,	6.1269212962963,	6.29611111111111,	7.72259259259259,	8.1340625,	8.26171296296296,	8.9205787037037,	8.05858796296296,	7.7628125,	6.22923611111111,/*2019*/
    4.71063657407407,	5.45614583333333,	4.65149305555556,	5.3690162037037,	5.5405787037037,	6.96836805555556,	7.37929398148148,	7.5055787037037,	8.16336805555556,	7.30131944444444,	7.00658564814815,	5.47459490740741,/*2020*/
    3.95748842592593,	5.70394675925926,	4.899375,	5.61608796296296,	5.78616898148148,	7.21212962962963,	7.62079861111111,	7.74508101851852,	8.40210648148148,	7.54081018518519,	7.24796296296296,	5.71809027777778,/*2021*/
    4.20190972222222,	5.94702546296296,	5.13903935185185,	5.85134259259259,	6.01790509259259,	7.44304398148148,	7.85355324074074,	7.98075231481482,	8.64057870370371,	7.78157407407407,	7.49045138888889,	5.96167824074074,/*2022*/
    4.44619212962963,	6.19181712962963,	5.3840625,	6.09635416666667,	6.26273148148148,	7.68796296296296,	8.09921296296296,	8.226875,	8.88581018518519,	8.02469907407408,	7.73119212962963,	6.20092592592593,/*2023*/
    4.68547453703704,	5.43244212962963,	4.6265625,	5.3403125,	5.50685185185185,	6.93056712962963,	7.3397337962963,	7.46618055555556,	8.12494212962963,	7.26391203703704,	6.97013888888889,	5.43939814814815,/*2024*/
    3.92391203703704,	5.67170138888889,	4.86706018518519,	5.58136574074074,	5.74755787037037,	7.17010416666667,	7.5774537037037,	7.70271990740741,	8.3619212962963,	7.50280092592593,	7.21150462962963,	5.68271990740741,/*2025*/
    4.16811342592593,	5.9159375,	5.11107638888889,	5.82547453703704,	5.991875,	7.41451388888889,	7.8212962962963,	7.94528935185185,	8.60363425925926,	7.74445601851852,	7.45311342592593,	5.92355324074074,/*2026*/
    4.40711805555556,	6.15243055555556,	5.34545138888889,	6.05912037037037,	6.22621527777778,	7.65069444444445,	8.06021990740741,	8.18638888888889,	8.84516203703704,	7.98509259259259,	7.69280092592593,	6.16290509259259,/*2027*/
    4.64663194444445,	5.39216435185185,	4.58543981481482,	5.30008101851852,	5.46939814814815,	6.89599537037037,	7.30631944444444,	7.43200231481482,	8.08918981481481,	7.22721064814815,	6.93373842592593,	5.40405092592593,/*2028*/
    3.88936342592593,	5.63717592592593,	4.83215277777778,	5.54699074074074,	5.71518518518519,	7.14047453703704,	7.54974537037037,	7.67486111111111,	8.33195601851852,	7.46989583333333,	7.17616898148148,	5.64614583333333,/*2029*/
    4.13079861111111,	5.87721064814815,	5.07005787037037,	5.78206018518519,	5.94747685185185,	7.37177083333333,	7.78277777777778,	7.91159722222222,	8.57300925925926,	7.71430555555556,	7.42186342592593,	5.89097222222222,/*2030*/
    4.37373842592593,	6.11868055555556,	5.31128472222222,	6.02434027777778,	6.19135416666667,	7.61715277777778,	8.02971064814815,	8.1597337962963,	8.82140046296296,	7.96216435185185,	7.66855324074074,	6.13606481481482,/*2031*/
    4.61722222222222,	5.36115740740741,	4.55376157407407,	5.26783564814815,	5.43597222222222,	6.8616087962963,	7.27259259259259,	7.40119212962963,	8.06265046296296,	7.20422453703704,	6.91189814814815,	5.38049768518519,/*2032*/
    3.86208333333333,	5.6056712962963,	4.7971875,	5.5094212962963,	5.67585648148148,	7.10052083333333,	7.51079861111111,	7.63899305555556,	8.3012037037037,	7.4450462962963,	7.15605324074074,	5.62798611111111,/*2033*/
    4.11175925925926,	5.8556712962963,	5.04583333333333,	5.75619212962963,	5.92114583333333,	7.34542824074074,	7.75615740740741,	7.88454861111111,	8.54643518518519,	7.68987268518519,	7.40039351851852,	5.87185185185185,/*2034*/
    4.35509259259259,	6.09819444444444,	5.28722222222222,	5.99630787037037,	6.16012731481482,	7.58396990740741,	7.9958912037037,	8.12655092592593,	8.78987268518519,	7.93304398148148,	7.64253472222222,	6.11336805555556,/*2035*/
    4.59699074074074,	5.34135416666667,	4.53193287037037,	5.24243055555556,	5.40744212962963,	6.83143518518519,	7.24211805555556,	7.37131944444444,	8.03380787037037,	7.17664351851852,	6.88592592592593,	5.35678240740741,/*2036*/
    3.8412037037037,	5.58741898148148,	4.78038194444444,	5.49247685185185,	5.65732638888889,	7.07974537037037,	7.48799768518519,	7.61475694444444,	8.27605324074074,	7.41927083333333,	7.12984953703704,	5.60171296296296,/*2037*/
    4.08574074074074,	5.82997685185185,	5.02023148148148,	5.72976851851852,	5.89256944444444,	7.3140162037037,	7.72290509259259,	7.85135416666667,	8.51474537037037,	7.66008101851852,	7.37225694444444,	5.84466435185185,/*2038*/
    4.3281712962963,	6.07131944444445,	5.26071759259259,	5.97069444444444,	6.13550925925926,	7.55958333333333,	7.97064814814815,	8.09978009259259,	8.76174768518519,	7.90453703703704,	7.61438657407407,	6.08559027777778,/*2039*/
    4.56912037037037,	5.31310185185185,	4.50357638888889,	5.21457175925926,	5.3803125,	6.80475694444445,	7.2150462962963,	7.3428587962963,	8.00357638888889,	7.14508101851852,	6.85393518518519,	5.32481481481482,/*2040*/
    3.80885416666667,	5.55378472222222,	4.74459490740741,	5.45424768518519,	5.61761574074074,	7.04033564814815,	7.45018518518519,	7.57857638888889,	8.2406712962963,	7.38381944444444,	7.0940162037037,	5.56577546296296,/*2041*/
    4.05030092592593,	5.79540509259259,	4.98627314814815,	5.69613425925926,	5.85958333333333,	7.28253472222222,	7.69331018518519,	7.82295138888889,	8.48621527777778,	7.63001157407407,	7.33944444444444,	5.80896990740741,/*2042*/
    4.29050925925926,	6.03287037037037,	5.22209490740741,	5.93168981481482,	6.09563657407407,	7.51902777777778,	7.93076388888889,	8.06231481481482,	8.72726851851852,	7.87178240740741,	7.58119212962963,	6.05003472222222,/*2043*/
    4.53043981481482,	5.27162037037037,	4.46016203703704,	5.17015046296296,	5.33579861111111,	6.76072916666667,	7.17231481481482,	7.3028125,	7.96724537037037,	7.11216435185185,	6.82273148148148,	5.29309027777778,/*2044*/
    3.77487268518519,	5.51706018518519,	4.70612268518519,	5.41599537037037,	5.58092592592593,	7.00527777777778,	7.41608796296296,	7.54511574074074,	8.20844907407408,	7.35371527777778,	7.06603009259259,	5.53854166666667,/*2045*/
    4.02125,	5.76201388888889,	4.94755787037037,	5.65291666666667,	5.81371527777778,	7.23596064814815,	7.64780092592593,	7.7797337962963,	8.44578703703704,	7.59282407407407,	7.30609953703704,	5.77907407407407,/*2046*/
    4.26216435185185,	6.00332175925926,	5.1890162037037,	5.89445601851852,	6.05581018518519,	7.47914351851852,	7.89261574074074,	8.02614583333333,	8.69247685185185,	7.83806712962963,	7.54896990740741,	6.0200462962963,/*2047*/
    4.50284722222222,	5.24556712962963,	4.43386574074074,	5.14164351851852,	5.30400462962963,	6.72657407407407,	7.13773148148148,	7.26914351851852,	7.93486111111111,	7.08076388888889,	6.79186342592593,	5.26261574074074,/*2048*/
    3.74501157407407,	5.4877662037037,	4.67628472222222,	5.3833912037037,	5.54387731481482,	6.96408564814815,	7.37318287037037,	7.50347222222222,	8.16978009259259,	7.31795138888889,	7.03200231481481,	5.50509259259259,/*2049*/
    3.98835648148148,	5.7306712962963,	4.91853009259259,	5.62599537037037,	5.78769675925926,	7.20925925925926,	7.61939814814815,	7.75008101851852,	8.41640046296296,	7.56466435185185,	7.27862268518519,	5.75113425925926,/*2050*/
    4.23302083333333,	5.97326388888889,	5.15912037037037,	5.8656712962963,	6.02788194444444,	7.450625,	7.86200231481482,	7.99358796296296,	8.65966435185185,	7.80665509259259,	7.51950231481482,	5.99166666666667,/*2051*/
    4.47390046296296,	5.21458333333333,	4.40054398148148,	5.10710648148148,	5.27006944444444,	6.69405092592593,	7.10604166666667,	7.2372337962963,	7.90226851851852,	7.04813657407407,	6.76038194444444,	5.23303240740741,/*2052*/
    3.71701388888889,	5.46024305555556,	4.64856481481482,	5.35626157407407,	5.51880787037037,	6.94207175925926,	7.35378472222222,	7.48476851851852,	8.14966435185185,	7.29554398148148,	7.0078587962963,	5.48037037037037,/*2053*/
    3.96344907407407,	5.70483796296296,	4.89063657407407,	5.59534722222222,	5.75481481481482,	7.17585648148148,	7.58778935185185,	7.72153935185185,	8.3900462962963,	7.5387037037037,	7.25197916666667,	5.72362268518519,/*2054*/
    4.20503472222222,	5.94505787037037,	5.13032407407407,	5.835625,	5.99675925925926,	7.41990740740741,	7.83366898148148,	7.96875,	8.63783564814815,	7.78625,	7.49855324074074,	5.96883101851852,/*2055*/
    4.4490162037037,	5.18859953703704,	4.37460648148148,	5.08153935185185,	5.24428240740741,	6.66790509259259,	7.08021990740741,	7.21302083333333,	7.8809375,	7.02971064814815,	6.74329861111111,	5.21493055555556,/*2056*/
    3.69579861111111,	5.43503472222222,	4.61947916666667,	5.32365740740741,	5.48315972222222,	6.90407407407407,	7.31483796296296,	7.44689814814815,	8.115,	7.26543981481482,	6.98200231481482,	5.45693287037037,/*2057*/
    3.94024305555556,	5.68009259259259,	4.8634837962963,	5.56627314814815,	5.72512731481482,	7.14650462962963,	7.55881944444444,	7.69267361111111,	8.36157407407407,	7.51150462962963,	7.22675925925926,	5.70042824074074,/*2058*/
    4.18291666666667,	5.92234953703704,	5.10547453703704,	5.80791666666667,	5.96646990740741,	7.38768518518519,	7.80010416666667,	7.93472222222222,	8.60421296296296,	7.75354166666667,	7.46739583333333,	5.93978009259259,/*2059*/
    4.42195601851852,	5.16216435185185,	4.34664351851852,	5.05017361111111,	5.20902777777778,	6.62965277777778,	7.04068287037037,	7.17364583333333,	7.84232638888889,	6.991875,	6.70625,	5.17908564814815,/*2060*/
    3.66190972222222,	5.40353009259259,	4.59015046296296,	5.29578703703704,	5.45560185185185,	6.87605324074074,	7.2862962962963,	7.41804398148148,	8.08579861111111,	7.235625,	6.95126157407407,	5.42510416666667,/*2061*/
    3.90726851851852,	5.64641203703704,	4.82976851851852,	5.5325462962963,	5.69042824074074,	7.10962962962963,	7.51969907407407,	7.65268518518519,	8.32222222222222,	7.47357638888889,	7.19020833333333,	5.66434027777778,/*2062*/
    4.14625,	5.88459490740741,	5.06690972222222,	5.76927083333333,	5.9284837962963,	7.350625,	7.76356481481482,	7.89790509259259,	8.56690972222222,	7.71634259259259,	7.43068287037037,	5.90326388888889,/*2063*/
    4.38489583333333,	5.12417824074074,	4.30819444444444,	5.01246527777778,	5.17331018518519,	6.5965625,	7.00956018518519,	7.14291666666667,	7.81070601851852,	6.95908564814815,	6.67271990740741,	5.14511574074074,/*2064*/
    3.6271412037037,	5.36706018518519,	4.55094907407407,	5.25336805555556,	5.41084490740741,	6.83075231481482,	7.24217592592593,	7.37596064814815,	8.04539351851852,	7.19585648148148,	6.91133101851852,	5.38487268518519,/*2065*/
    3.86719907407407,	5.60662037037037,	4.78971064814815,	5.49174768518519,	5.64952546296296,	7.0703587962963,	7.48358796296296,	7.61997685185185,	8.29186342592593,	7.44353009259259,	7.15827546296296,	5.62951388888889,/*2066*/
    4.10885416666667,	5.84579861111111,	5.02780092592593,	5.73028935185185,	5.88940972222222,	7.3115162037037,	7.7253587962963,	7.86231481481482,	8.53498842592593,	7.68741898148148,	7.4028125,	5.87421296296296,/*2067*/
    4.35310185185185,	5.08914351851852,	4.27024305555556,	4.9722337962963,	5.13123842592593,	6.55298611111111,	6.9656712962963,	7.10087962962963,	7.77256944444444,	6.9255787037037,	6.64278935185185,	5.11648148148148,/*2068*/
    3.59739583333333,	5.33471064814815,	4.51626157407407,	5.21814814814815,	5.3769212962963,	6.79888888888889,	7.21210648148148,	7.34728009259259,	8.01835648148148,	7.17145833333333,	6.89011574074074,	5.3659375,/*2069*/
    3.8480787037037,	5.58461805555556,	4.76334490740741,	5.46126157407407,	5.61627314814815,	7.03576388888889,	7.44863425925926,	7.5855787037037,	8.25887731481481,	7.41318287037037,	7.13207175925926,	5.60788194444444,/*2070*/
    4.09046296296296,	5.82780092592593,	5.00696759259259,	5.70461805555556,	5.85929398148148,	7.27931712962963,	7.69346064814815,	7.8315162037037,	8.50513888888889,	7.65842592592593,	7.37515046296296,	5.84887731481482,/*2071*/
    4.33085648148148,	5.06969907407407,	4.25217592592593,	4.95357638888889,	5.11068287037037,	6.53097222222222,	6.94358796296296,	7.07956018518519,	7.75188657407407,	6.90505787037037,	6.62215277777778,	5.09603009259259,/*2072*/
    3.57790509259259,	5.31677083333333,	4.4991087962963,	5.19946759259259,	5.35422453703704,	6.77103009259259,	7.18032407407407,	7.31439814814815,	7.9866087962963,	7.14134259259259,	6.86100694444445,	5.33715277777778,/*2073*/
    3.81993055555556,	5.55814814814815,	4.73928240740741,	5.43930555555556,	5.59521990740741,	7.01417824074074,	7.42547453703704,	7.56091435185185,	8.2337962962963,	7.38829861111111,	7.10685185185185,	5.58145833333333,/*2074*/
    4.06253472222222,	5.79917824074074,	4.97947916666667,	5.6799537037037,	5.83759259259259,	7.25896990740741,	7.67209490740741,	7.80791666666667,	8.47979166666667,	7.63267361111111,	7.34993055555556,	5.82395833333333,/*2075*/
    4.30509259259259,	5.0419212962963,	4.22208333333333,	4.92209490740741,	5.07916666666667,	6.49989583333333,	6.9125,	7.0475462962963,	7.71828703703704,	6.87009259259259,	6.58677083333333,	5.06106481481482,/*2076*/
    3.54344907407407,	5.28215277777778,	4.4640162037037,	5.16494212962963,	5.3222337962963,	6.74327546296296,	7.15690972222222,	7.29349537037037,	7.96545138888889,	7.11787037037037,	6.83466435185185,	5.30849537037037,/*2077*/
    3.78945601851852,	5.52594907407407,	4.70524305555556,	5.40353009259259,	5.5584837962963,	6.97795138888889,	7.39140046296296,	7.52993055555556,	8.20518518518519,	7.3603125,	7.07792824074074,	5.55065972222222,/*2078*/
    4.02961805555556,	5.76420138888889,	4.94226851851852,	5.64012731481482,	5.79541666666667,	7.21609953703704,	7.63112268518519,	7.7706712962963,	8.44645833333333,	7.60179398148148,	7.31909722222222,	5.79101851851852,/*2079*/
    4.26905092592593,	5.00321759259259,	4.18207175925926,	4.88203703703704,	5.03976851851852,	6.46188657407407,	6.87680555555556,	7.01521990740741,	7.69015046296296,	6.84592592592593,	6.56481481481482,	5.03854166666667,/*2080*/
    3.51765046296296,	5.25152777777778,	4.42828703703704,	5.12461805555556,	5.27824074074074,	6.69652777777778,	7.1087037037037,	7.24591435185185,	7.92086805555556,	7.07796296296296,	6.79950231481482,	5.27644675925926,/*2081*/
    3.758125,	5.4928125,	4.66849537037037,	5.3628125,	5.5150462962963,	6.93375,	7.34778935185185,	7.4875462962963,	8.16459490740741,	7.32206018518519,	7.04239583333333,	5.51782407407407,/*2082*/
    3.99851851851852,	5.73314814814815,	4.90958333333333,	5.60494212962963,	5.75796296296296,	7.17731481481482,	7.59189814814815,	7.73194444444444,	8.4090162037037,	7.56611111111111,	7.285625,	5.76008101851852,/*2083*/
    4.2403587962963,	4.97539351851852,	4.15275462962963,	4.84892361111111,	5.0015625,	6.41873842592593,	6.83047453703704,	6.96796296296296,	7.64357638888889,	6.80072916666667,	6.52131944444444,	4.99709490740741,/*2084*/
    3.47873842592593,	5.21528935185185,	4.39434027777778,	5.09206018518519,	5.24590277777778,	6.66378472222222,	7.0756712962963,	7.21319444444444,	7.88887731481482,	7.04662037037037,	6.76847222222222,	5.2452662037037,/*2085*/
    3.72635416666667,	5.46070601851852,	4.63690972222222,	5.33225694444444,	5.48484953703704,	6.9025,	7.31456018518519,	7.45275462962963,	8.12958333333333,	7.28835648148148,	7.01070601851852,	5.48758101851852,/*2086*/
    3.96855324074074,	5.70244212962963,	4.8778125,	5.57239583333333,	5.72502314814815,	7.1441087962963,	7.55822916666667,	7.69715277777778,	8.37296296296296,	7.52967592592593,	7.24991898148148,	5.72555555555556,/*2087*/
    4.20671296296296,	4.94206018518519,	4.11967592592593,	4.81685185185185,	4.97190972222222,	6.39270833333333,	6.80774305555556,	6.94688657407407,	7.6221412037037,	6.77793981481482,	6.49739583333333,	4.97274305555556,/*2088*/
    3.45428240740741,	5.19041666666667,	4.36803240740741,	5.06344907407407,	5.2153125,	6.63239583333333,	7.04458333333333,	7.18302083333333,	7.859375,	7.01689814814815,	6.73783564814815,	5.21405092592593,/*2089*/
    3.69570601851852,	5.43128472222222,	4.60815972222222,	5.30295138888889,	5.45451388888889,	6.87230324074074,	7.28633101851852,	7.42734953703704,	8.10644675925926,	7.26543981481482,	6.9856712962963,	5.45936342592593,/*2090*/
    3.93774305555556,	5.67074074074074,	4.84700231481482,	5.5434837962963,	5.69792824074074,	7.11834490740741,	7.53403935185185,	7.6756712962963,	8.35482638888889,	7.51405092592593,	7.23474537037037,	5.70855324074074,/*2091*/
    4.18635416666667,	4.9181712962963,	4.093125,	4.78876157407407,	4.94255787037037,	6.36144675925926,	6.7746875,	6.91372685185185,	7.59111111111111,	6.75028935185185,	6.47263888888889,	4.9490162037037,/*2092*/
    3.42925925925926,	5.16246527777778,	4.33734953703704,	5.03185185185185,	5.18482638888889,	6.60429398148148,	7.01892361111111,	7.15920138888889,	7.8371875,	6.99675925925926,	6.72003472222222,	5.19759259259259,/*2093*/
    3.67819444444444,	5.41040509259259,	4.58303240740741,	5.27450231481482,	5.42466435185185,	6.84275462962963,	7.2577662037037,	7.3997337962963,	8.07976851851852,	7.24046296296296,	6.96364583333333,	5.44068287037037,/*2094*/
    3.92126157407407,	5.65386574074074,	4.82670138888889,	5.51767361111111,	5.66664351851852,	7.08372685185185,	7.49875,	7.64097222222222,	8.32085648148148,	7.48069444444444,	7.20219907407407,	5.67743055555556,/*2095*/
    4.1572337962963,	4.89079861111111,	4.06618055555556,	4.7605787037037,	4.91248842592593,	6.3306712962963,	6.74512731481482,	6.88650462962963,	7.5659375,	6.72601851851852,	6.44820601851852,	4.92392361111111,/*2096*/
    3.40385416666667,	5.13741898148148,	4.31237268518519,	5.00539351851852,	5.15506944444444,	6.57010416666667,	6.98087962962963,	7.11975694444444,	7.79893518518519,	6.96072916666667,	6.68564814814815,	5.16390046296296,/*2097*/
    3.64483796296296,	5.37748842592593,	4.55059027777778,	5.24197916666667,	5.39094907407407,	6.80689814814815,	7.21952546296296,	7.35990740740741,	8.03994212962963,	7.2015625,	6.92533564814815,	5.40197916666667,/*2098*/
    3.8812962962963,	5.61263888888889,	4.78542824074074,	5.47822916666667,	5.63010416666667,	7.04949074074074,	7.46512731481482,	7.60675925925926,	8.2859375,	7.4459837962963,	7.16864583333333,	5.6450462962963,/*2099*/
    4.12490740740741,	5.85703703703704,	5.03013888888889,	5.72258101851852,	5.87340277777778,	7.29070601851852,	7.70393518518519,	7.84366898148148,	8.52138888888889,	7.68033564814815,	7.40256944444444,	5.87946759259259,/*2100*/
);
simpleLunarVars.festX = [6.0860763888888889,7.628159722222222,7.949178240740741,8.847013888888889];

simpleLunarVars.ymonth=new make_n_array(INDEX_YEAR_COUNT);// number of lunar months in the years
simpleLunarVars.yday=new make_n_array(INDEX_YEAR_COUNT);  // number of lunar days in the years
simpleLunarVars.mday=new make_n_array(MAX_LUNAR_MONTHS+1);// number of days in the months of the lunar year,常变值
simpleLunarVars.moon=new make_array(29,30);// a short (long) lunar month has 29 (30) days
simpleLunarVars.solarFirstDate=new MyDate(SIMPLE_MIN_YEAR,1,31,0,3,0);
/* Wednesday, 12 a.m., First day, First month, 1900 */
simpleLunarVars.lunarFirstDate=new MyDate(SIMPLE_MIN_YEAR, 1, 1, 0, 3, 0);
//己亥年 丁丑月 甲辰日
    /* geng1-nian2 wu4-yue4 jia3-ri4 jia3-shi2 */
simpleLunarVars.ganFirstDate=new MyDate(6,4,0,0,3,0);

    /* zi3-nian2 yin2-yue4 chen2-ri4 zi3-shi2 */
simpleLunarVars.zhiFirstDate=new MyDate(0,2,4,0,3,0);
/**
 * 快捷日历的第一天的干支序号:甲辰日
 * @type {number} 0~59
 */
simpleLunarVars.GZFirstID = 40;
/**
 * 阳历
 * @type {MyDate}
 */
simpleLunarVars.solar=new MyDate();
/**
 * 阴历
 * @type {MyDate}
 */
simpleLunarVars.lunar=new MyDate();
/**
 * 当前日期(阴历年)的干信息
 * @type {MyDate}
 */
simpleLunarVars.gan=new MyDate();
/**
 * 当前日期(阴历年)的支信息
 * @type {MyDate}
 */
simpleLunarVars.zhi=new MyDate();
/**
 * 阴历
 * 年以立春为分界点,月以月节为分界点
 * @type {MyDate}
 */
simpleLunarVars.lunar2=new MyDate();
/**
 * 当前日期(阳历年)的干信息
 * 年以立春为分界点
 * 月以月节为分界点
 * @type {MyDate}
 */
simpleLunarVars.gan2=new MyDate();
/**
 * 当前日期(阳历年)的支信息
 * 年以立春为分界点
 * 月以月节为分界点
 * @type {MyDate}
 */
simpleLunarVars.zhi2=new MyDate();

/**
 * 1900-1-31 距历元天数
 * @type {number}
 */
simpleLunarVars.solarFirstDateDays = null;
/**
 * 当天日月升降数据
 * @type {Object}
 */
simpleLunarVars.SM_rise_set = new Object();
/**
 * 存储已经计算好的月历数据
 * 包含两个成员:tag(月份标识),calendar(月历对象)
 * @type {Object}
 */
simpleLunarVars.monthlyCalendar = new Object();
/*----------------------------------------------------------
function report(type,ans) {
  var answer,answer2;
//  alert("type"+type+"ans="+ans);
//  answer=title+simpleLunarVars.solar.y+"年"+simpleLunarVars.solar.m+"月"+simpleLunarVars.solar.d+"日,星期"+simpleLunarVars.solar.w;
  if(type==0) { //阳->阴
    answer="阴历"+simpleLunarVars.lunar.y+"("+HeavenlyStems[simpleLunarVars.gan.y]+EarthlyBranches[simpleLunarVars.zhi.y]+")年"+(simpleLunarVars.lunar.l?"闰":"")+simpleLunarVars.lunar.m+"月"+simpleLunarVars.lunar.d+"日,生肖属"+ShengXiaoGB[simpleLunarVars.zhi.y];
//    answer2="干支:"+HeavenlyStems[simpleLunarVars.gan.y]+EarthlyBranches[simpleLunarVars.zhi.y]+"年"+
//        HeavenlyStems[simpleLunarVars.gan.m]+EarthlyBranches[simpleLunarVars.zhi.m]+"月"+HeavenlyStems[simpleLunarVars.gan.d]+EarthlyBranches[simpleLunarVars.zhi.d]+"日";
  }
  else {
    answer="阳历"+simpleLunarVars.solar.y+"年"+simpleLunarVars.solar.m+"月"+simpleLunarVars.solar.d+"日,星期"+WeekdayList[simpleLunarVars.solar.w];
//    answer2="干支:"+HeavenlyStems[simpleLunarVars.gan.y]+EarthlyBranches[simpleLunarVars.zhi.y]+"年"+
//        HeavenlyStems[simpleLunarVars.gan.m]+EarthlyBranches[simpleLunarVars.zhi.m]+"月"+HeavenlyStems[simpleLunarVars.gan.d]+EarthlyBranches[simpleLunarVars.zhi.d]+"日";
  }
//  answer2=title+simpleLunarVars.lunar.y+"年"+simpleLunarVars.lunar.m+"月"+simpleLunarVars.lunar.d+"日,星期"+simpleLunarVars.lunar.w;
//  alert(answer);
  ans.value=answer;
//  ans2.value=answer2;
}
----------------------------------------------------------*/
function LeapYear(y) {
  return ( ((y%4)==0) && ((y%100)!=0) || ((y%400)==0) );
}

/**
 * 将时间转换为天(小数形式)
 * @param {string|int} hour
 * @return {number}
 * @constructor
 */
function Hour2Day(hour){
    let ret = 0;
    if(!hour) return ret;
    if(typeof hour == 'string' && hour.length == 1){
        let px = EarthlyBranches.indexOf(hour);
        if(px > -1){
            ret = px * 2;
            return ret / 24;
        }
    }
    if(typeof hour == 'string'){
        if(hour.indexOf(':') > 0){
            let p3 = hour.replace(/^[\s\:]+|[\s\:]+$/gm,'').split(':');
            if(p3.length > 0){
                ret += parseInt(p3[0]);
                if(p3.length > 1) ret += parseInt(p3[1])/60;
                if(p3.length > 2) ret += parseInt(p3[2])/3600;
                if(p3.length > 3) ret += parseInt(p3[3])/3600000;
            }
        }
        else{
            if(hour.indexOf('.') >= 0) ret = parseFloat(hour);
            else ret = parseInt(hour);
        }
    }
    else{
        ret = parseInt(hour);
    }
    return ret / 24;
}
/**
 * 计算距历元的天数
 * @param {MyDate} d
 * @returns {number}
 */
function solar2Day1(d) {
    let offset, delta;
    let i;
    delta = d.y - EPOCH_YEAR;//EPOCH_YEAR
    if (delta < 0) {
        alert("internal error:pick a larger constant for EPOCH_YEAR");
        return -1;
    }
    offset = Math.floor(delta * 365) + Math.floor(delta / 4) - Math.floor(delta / 100) + Math.floor(delta / 400);
    for (i = 1; i < d.m; i++) {
        offset += DaysInSolarMonth[i];
    }
    let isLeapY = LeapYear(d.y);
    if ((d.m > 2) && isLeapY) offset++;
    offset += d.d - 1;
    let iD=parseInt(d.d);
    if ((d.m == 2) && isLeapY) {
        if (iD > 29) {
            alert("day1 out of range");
            return -1;
        }
    } else if (iD > DaysInSolarMonth[d.m]) {
        alert("day2 out of range");
        return -1;
    }
    return parseInt(offset);
}
/*----------------------------------------------------------*/
/**
 * 计算指定日期距离1900/1/31有多少天
 * @param {MyDate} d
 * @returns {number}
 */
function solar2Day(d) {
//  alert("d="+d);
//  alert("1:"+solar2Day1(d)+"\n2:"+solar2Day1(simpleLunarVars.solarFirstDate));
    if(simpleLunarVars.solarFirstDateDays === null){
        simpleLunarVars.solarFirstDateDays=solar2Day1(simpleLunarVars.solarFirstDate);
    }
  return (solar2Day1(d)-simpleLunarVars.solarFirstDateDays);
}
/*----------------------------------------------------------*/
/* Compute the number of days in each lunar year in the table */
function make_yday()
{
  let year, i, leap;
  let code;

  if(typeof simpleLunarVars.hasYday == 'undefined' || !simpleLunarVars.hasYday) {
      for (year = 0; year < INDEX_YEAR_COUNT; year++) {
          code = simpleLunarVars.yearInfo[year];
          leap = code & 0xf;
          simpleLunarVars.yday[year] = 0;
          if (leap != 0) {
              i = (code >> 16) & 0x1;
              simpleLunarVars.yday[year] += simpleLunarVars.moon[i];
          }
          code >>= 4;
          for (i = 0; i < MAX_LUNAR_MONTHS - 1; i++) {
              simpleLunarVars.yday[year] += simpleLunarVars.moon[code & 0x1];
              code >>= 1;
          }
          simpleLunarVars.ymonth[year] = 12;
          if (leap != 0) simpleLunarVars.ymonth[year]++;
      }
      simpleLunarVars.hasYday = true;
  }
  return INDEX_YEAR_COUNT;
}
/*----------------------------------------------------------*/
/* Compute the days of each month in the given lunar year */
/**
 * 获取指定年份的阴历每月天数,结果会缓存在simpleLunarVars.mdays中
 * @param {int} year
 * @returns {number}
 */
function make_mday(year)
{
    let code = simpleLunarVars.yearInfo[year];
    let leapMonth = code & 0xf;
    if(Array.isArray(simpleLunarVars.mdays) && typeof simpleLunarVars.mdays[year] == 'object' && simpleLunarVars.mdays[year].length > 0){
        simpleLunarVars.mday = simpleLunarVars.mdays[year];
        return leapMonth;
    }
    let i=0;
    simpleLunarVars.mday=new make_n_array(MAX_LUNAR_MONTHS+1);
    if(year < 0) return 0;
    /* leapMonth == 0 means no leap month */
    code >>= 4;
    if (leapMonth == 0)
    {
        simpleLunarVars.mday[MAX_LUNAR_MONTHS] = 0;
        for (i = MAX_LUNAR_MONTHS-1; i >= 1; i--)
        {
            simpleLunarVars.mday[i] = simpleLunarVars.moon[code&0x1];
            code >>= 1;
        }
    }
    else
    {
        /* 
          There is a leap month (run4 yue4) L in this year.
          simpleLunarVars.mday[1] contains the number of days in the 1-st month;
          simpleLunarVars.mday[L] contains the number of days in the L-th month;
          simpleLunarVars.mday[L+1] contains the number of days in the L-th leap month;
          simpleLunarVars.mday[L+2] contains the number of days in the L+1 month, etc.

          cf. simpleLunarVars.yearInfo[]: info about the leap month is encoded differently.
        */
        i = (simpleLunarVars.yearInfo[year] >> 16) & 0x1;
        simpleLunarVars.mday[leapMonth+1] = simpleLunarVars.moon[i];
        for (i = MAX_LUNAR_MONTHS; i >= 1; i--)
        {
            if (i == leapMonth+1) i--;
            simpleLunarVars.mday[i] = simpleLunarVars.moon[code&0x1];
            code >>= 1;
        }
    }
    if(typeof simpleLunarVars.mdays === 'undefined' || Array.isArray(simpleLunarVars.mdays)==false){
        simpleLunarVars.mdays = new Array(INDEX_YEAR_COUNT);
    }
    simpleLunarVars.mdays[year] = simpleLunarVars.mday;// Object.assign({}, simpleLunarVars.mday);
    return leapMonth;
}
/*----------------------------------------------------------*/
/**
 * 按距阴历1900/1/1指定天数的阴历日期
 * @param {int} offset 距离最小阳历的天数
 * @param {MyDate} d
 * @return {MyDate}
 */
function day2Lunar(offset) {
  let i,m,nYear,leapMonth;
  let d = new MyDate();
  nYear = make_yday();
  offset = parseInt(offset);
  for (i=0; i<nYear && offset > 0; i++)  offset -= simpleLunarVars.yday[i];

  if (offset<0)  offset += simpleLunarVars.yday[--i];

  if (i==INDEX_YEAR_COUNT) {
    alert("Year out of range.");
    return ;
  }

  d.y = i + simpleLunarVars.lunarFirstDate.y;

  leapMonth = make_mday(i);
  for (m=1; m<=MAX_LUNAR_MONTHS && offset>0; m++)  offset -= simpleLunarVars.mday[m];

  if (offset<0) offset += simpleLunarVars.mday[--m];

  d.l= 0;        /* don't know leap or not yet */

  if (leapMonth>0)  {  /* has leap month */
// if preceeding month number is the leap month, this month is the actual extra leap month 
    d.l = (leapMonth == (m - 1));
    /* month > leapMonth is off by 1, so adjust it */
    if (m > leapMonth) --m;
  }

  d.m = m;
  d.d = offset + 1;
  return d;
}
/*----------------------------------------------------------*/
/**
 * 获取年月日时的干支序号
 * @param {number} offset
 * @param {MyDate} d 阴历日期
 * @return {{g: MyDate, z: MyDate}}
 * @constructor
 */
function CalGZ(offset, d) {
    let year, month;
    year = d.y - simpleLunarVars.lunarFirstDate.y;
    month = year * 12 + d.m - 1;   /* leap months do not count */
    let ret = {g: new MyDate(), z: new MyDate()};
//  alert("year="+year+"month="+month);
    let iOffset = parseInt(offset);
    let hx = int2((parseFloat(offset) - iOffset) * 24);
    if(!d.h && hx != 0){
        d.h = hx;
    }
    ret.g.y = (simpleLunarVars.ganFirstDate.y + year) % 10;
    ret.z.y = (simpleLunarVars.zhiFirstDate.y + year) % 12;
    if(ret.g.y < 0) ret.g.y += 10;
    if(ret.z.y < 0) ret.z.y += 12;
    ret.g.m = (simpleLunarVars.ganFirstDate.m + month) % 10;
    ret.z.m = (simpleLunarVars.zhiFirstDate.m + month) % 12;
    ret.g.d = (simpleLunarVars.ganFirstDate.d + iOffset) % 10;
    ret.z.d = (simpleLunarVars.zhiFirstDate.d + iOffset) % 12;
    ret.z.h = Math.floor((d.h + 1) / 2) % 12;
    ret.g.h = (ret.g.d * 12 + ret.z.h) % 10;
    return ret;
}
/*----------------------------------------------------------*/
/* Compare two dates and return <,=,> 0 if the 1st is <,=,> the 2nd */
function CmpDate(month1, day1, month2, day2)
{
    if (month1!=month2) return(month1-month2);
    if (day1!=day2) return(day1-day2);
    return(0);
}
/*----------------------------------------------------------*/
/* Given a solar date, find the "lunar" date for the purpose of
   calculating the "4-columns" by taking jie into consideration.
*/
/**
 * 获取指定阳历日期的月令(年与月)
 * @param {MyDate} ds
 * @return {MyDate} 会设置成员flag
 */
function getSolarYueLing(ds)//MyDate type
{
    let m, flag;
    let dl = new MyDate();
    if (ds.m != 1) {
        for (m = Math.max(ds.m - 3, 2); m <= 12; m++) {
            let fvi = (ds.y - simpleLunarVars.solarFirstDate.y) * 12 + m - 2;
            let fv = 0;
            if(fvi >= 0) fv = simpleLunarVars.fest[fvi];
            else fv = simpleLunarVars.festX[fvi * -1];
            flag = CmpDate(ds.m, ds.d, m,fv);
            if (flag == 0) m++;
            if (flag <= 0) break;
        }
        dl.m = (m - 2) % 12;
        dl.y = ds.y;
        if ((dl.m) == 0) {
            dl.y = ds.y - 1;
            dl.m = 12;
        }
    }
    else{
        let fvi = (ds.y - simpleLunarVars.solarFirstDate.y - 1)*12+11;
        let fv = 0;
        if(fvi >= 0) fv = simpleLunarVars.fest[fvi];
        else fv = simpleLunarVars.festX[fvi * -1];
        flag = CmpDate(ds.m, ds.d,1,fv);
        if (flag<0) dl.m = 11;
        else if (flag>0) dl.m = 12;
        dl.y = ds.y - 1;
    }
    dl.flag = (flag==0);
    return dl;
}
/*----------------------------------------------------------*/
/**
 * 阳历转阴历
 * 输入项:simpleLunarVars.solar 为阳历日期
 * @returns {boolean}
 */
function solar2Lunar() {
    let offset = solar2Day(simpleLunarVars.solar);//得到距离最小阳历的天数
    if (offset < 0) return false;
    let tmpH = int2((simpleLunarVars.solar.d - parseInt(simpleLunarVars.solar.d)) * 24);
    if( ! simpleLunarVars.solar.h && tmpH) simpleLunarVars.solar.h = tmpH;
    simpleLunarVars.solar.w = (offset + simpleLunarVars.solarFirstDate.w) % 7;
//alert("offset="+offset+",w="+simpleLunarVars.solar.w);
//a lunar day begins at 11pm
    if (simpleLunarVars.setting.isLimit23H && simpleLunarVars.solar.h == 23) offset++;//晚子时,算为下一天

    simpleLunarVars.lunar = day2Lunar(offset);//根据天数得到阴历日期
    simpleLunarVars.lunar.h = simpleLunarVars.solar.h;
    let gzR = CalGZ(offset, simpleLunarVars.lunar);//获取阴历的干支序列
    if (gzR) {
        simpleLunarVars.gan = gzR.g;
        simpleLunarVars.zhi = gzR.z;
    }
    simpleLunarVars.lunar2 = getSolarYueLing(simpleLunarVars.solar);
    simpleLunarVars.jieAlert = simpleLunarVars.lunar2.flag;
    delete simpleLunarVars.lunar2.flag;//邮件临时变量
    simpleLunarVars.lunar2.d = simpleLunarVars.lunar.d;
    simpleLunarVars.lunar2.h = simpleLunarVars.lunar.h;
    let gzR2 = CalGZ(offset, simpleLunarVars.lunar2);
    if (gzR2) {
        simpleLunarVars.gan2 = gzR2.g;
        simpleLunarVars.zhi2 = gzR2.z;
    }
    //simpleLunarVars.lunar.d = parseInt(simpleLunarVars.lunar.d);
    //simpleLunarVars.lunar2.d = parseInt(simpleLunarVars.lunar2.d);
    return true;
}
/*----------------------------------------------------------*/
/* Compute offset days of a lunar date from the beginning of the table */
function Lunar2Day(d)
{
    let offset = 0;
    let year, i, m, nYear, leapMonth;

    nYear = make_yday();//每个阴历年有多少天的列表
    year = d.y - simpleLunarVars.lunarFirstDate.y;
    for (i=0; i<year; i++)  offset += simpleLunarVars.yday[i];

    leapMonth = make_mday(year);
    if ((d.l) && (leapMonth!=d.m)) {
      alert(d.m +"is not a leap month in year "+d.y);
      return -1;
//        printf("%d is not a leap month in year %d.\n", d->month, d->year);
//        exit(1);
    }
    for (m=1; m<d.m; m++) offset += simpleLunarVars.mday[m];
    if (leapMonth && ((d.m>leapMonth) || (d.l && (d.m==leapMonth))))
        offset += simpleLunarVars.mday[m++];
    offset += d.d- 1;

    if (d.d > simpleLunarVars.mday[m]) Error("Day out of range.");

    return offset;
}
/*----------------------------------------------------------*/
function Solar2Day(d)
{
    return (Solar2Day1(d) - Solar2Day1(simpleLunarVars.solarFirstDate));
}
/*----------------------------------------------------------*/
/* Compute the number of days from the Solar date EPOCH_YEAR.1.1 */
function Solar2Day1(d)
{
    let offset, delta;
    let i;

    delta = d.y - EPOCH_YEAR;
    if (delta<0) {
//Error("Internal error: pick a larger constant for EPOCH_YEAR.");
      alert("Internal error: pick a larger constant for EPOCH_YEAR.");
      return -1;
    }
    offset = delta * 365 + Math.floor(delta / 4) - Math.floor(delta / 100) + 
        Math.floor(delta / 400);
    for (i=1; i< d.m; i++)
        offset += DaysInSolarMonth[i];
    if ((d.m > 2) && LeapYear(d.y))  offset++;
    offset += d.d - 1;

    if ((d.m == 2) && LeapYear(d.y)) {
        if (d.d > 29){
// Error("Day out of range.");
           alert("Day out of range.");
           return -1;
        }
    }
    else if (d.d > DaysInSolarMonth[d.m]) {
//       Error("Day out of range.");
      alert("Day out of range.");
      return -1;
    }
    return offset;
}
/*----------------------------------------------------------*/
/**
 * 获取距离阳历1900/1/31指定天数的阳历日期
 * @param {int} offset
 * @return {MyDate}
 * @constructor
 */
function Day2Solar(offset)
{
    let i, m, days;
    let d = new MyDate();
    /* offset is the number of days from SolarFirstDate */
    offset -= Solar2Day(simpleLunarVars.lunarFirstDate);  /* the argument is negative */
    /* offset is now the number of days from SolarFirstDate.year.1.1 */

    for (i=simpleLunarVars.solarFirstDate.y;(i<simpleLunarVars.solarFirstDate.y+INDEX_YEAR_COUNT) && (offset > 0);  i++)
        offset -= 365 + LeapYear(i);
    if (offset<0) {
        --i;    /* LeapYear is a macro */
        offset += 365 + LeapYear(i);
    }
    if (i==(simpleLunarVars.solarFirstDate.y + INDEX_YEAR_COUNT)) {
//Error("Year out of range.");
      alert("Year out of range.");
      return ;
    }
    d.y = i;
    
    /* assert(offset<(365+LeapYear(i))); */
    for (m=1; m<=12; m++) {
        days = DaysInSolarMonth[m];
        if ((m==2) && LeapYear(i))      /* leap February */
            days++;
        if (offset<days) {
            d.m = m;
            d.d = offset + 1;
            return;
        }
        offset -= days;
    }
    return d;
}
/*----------------------------------------------------------*/
function Lunar2Solar() {
    let offset;
    let adj;
    let d;

    /* A solar day begins at 12 a.m. */
    adj = (simpleLunarVars.setting.isLimit23H && simpleLunarVars.lunar.h == 23) ? -1 : 0;//晚子时算前一天
    adj = 0;
    offset = Lunar2Day(simpleLunarVars.lunar);
    let tmpH = int2((simpleLunarVars.solar.d - parseInt(simpleLunarVars.solar.d)) * 24);
    if( ! simpleLunarVars.solar.h && tmpH) simpleLunarVars.solar.h = tmpH;
//    alert("offset:"+offset);
    simpleLunarVars.solar.w = (offset + adj + simpleLunarVars.solarFirstDate.w) % 7;
    simpleLunarVars.solar = Day2Solar(offset + adj);
    simpleLunarVars.solar.h = simpleLunarVars.lunar.h;
    let gzR = CalGZ(offset, simpleLunarVars.lunar);
    if (gzR) {
        simpleLunarVars.gan = gzR.g;
        simpleLunarVars.zhi = gzR.z;
    }
    simpleLunarVars.lunar2 = getSolarYueLing(simpleLunarVars.solar);
    simpleLunarVars.jieAlert = simpleLunarVars.lunar2.flag;
    delete simpleLunarVars.lunar2.flag;
    simpleLunarVars.lunar2.d = simpleLunarVars.lunar.d;
    simpleLunarVars.lunar2.h = simpleLunarVars.lunar.h;
    let gzR2 = CalGZ(offset, simpleLunarVars.lunar2);
    if (gzR2) {
        simpleLunarVars.gan2 = gzR2.g;
        simpleLunarVars.zhi2 = gzR2.z;
    }
    return true;
}
/*----------------------------------------------------------*/
/********************
 升降计算等
 *********************/

function getRTSInfo(jd, vJ, vW, tz) {
    SZJ.calcRTS(jd, 1, vJ, vW, tz); //升降计算,使用北时时间,tz=-8指东8区,jd+tz应在当地正午左右(误差数小时不要紧)
    let storage = false;
    if(typeof SZJ.rts !== 'undefined' && SZJ.rts.length > 0 && typeof SZJ.rts[0].s !== 'undefined') {
        let ob = SZJ.rts[0];
        storage = new Object();
        storage.sunrise = ob.s;//日出
        storage.sunset = ob.j;//日落
        storage.sunriseZenith = ob.z;//中天
        storage.moonrise = ob.Ms;//月出
        storage.moonset = ob.Mj;//月落
        storage.moonZenith = ob.Mz;//月中
        storage.dawn = ob.c;//晨起天亮
        storage.darkness = ob.h;//晚上天黑
        storage.sunlight = ob.sj;//日照时间
        storage.daytime = ob.ch;//白天时间
    }
// JD.setFromJD(jd+J2000);
    return storage;
}
//type=0,default,阳->阴
//type=1,阴->阳
function simpleLunar(type, my_y, my_m, my_d) {
    let retv = false;
    //不在计算范围内:
    if (my_y < SIMPLE_MIN_YEAR || my_y > SIMPLE_MAX_YEAR || ((my_y == SIMPLE_MIN_YEAR) && (my_m == 1) && (my_d < 31))) return null;
    if (type == 0) {//阳->阴
        simpleLunarVars.solar.y = my_y;
        simpleLunarVars.solar.m = my_m;
        simpleLunarVars.solar.d = my_d;
        title = "阴历:";
        retv = solar2Lunar();
    } else {//阴->阳
        simpleLunarVars.lunar.y = my_y;
        simpleLunarVars.lunar.m = my_m;
        simpleLunarVars.lunar.d = my_d;
        title = "阳历:";
        retv = Lunar2Solar();
    }
    return retv;
}

/**
 * 计算天文历
 * @param {int} type 转换类型
 * @param {int} my_y 年
 * @param {int} my_m 月
 * @param {number} my_d 日,可以是小数,即包含时间信息
 * @return {boolean}
 */
function astroLunar(type, my_y, my_m, my_d){
    let retv = false;
    my_y = parseInt(my_y);
    let calendarTag = my_y+"/"+my_m;
    if(typeof simpleLunarVars.monthlyCalendar.tag != 'string' || simpleLunarVars.monthlyCalendar.tag != calendarTag) {
        /**
         * 月历的月份标识
         * @type {string}
         */
        simpleLunarVars.monthlyCalendar.tag = calendarTag;
        /**
         * 月历对象
         * @type {Lunar}
         */
        simpleLunarVars.monthlyCalendar.calendar = getLunar(my_y,my_m);
    }
    let obx = simpleLunarVars.monthlyCalendar.calendar;
    if (type == 0) {//阳->阴
        simpleLunarVars.solar.y = my_y;
        simpleLunarVars.solar.m = my_m;
        simpleLunarVars.solar.d = parseInt(my_d);
        if(simpleLunarVars.solar.d < my_d){ //有时间信息
            simpleLunarVars.solar.h = HourChen[int2((my_d - simpleLunarVars.solar.d) * 24)];
        }
        title = "阴历:";
        let ob = obx.lun[simpleLunarVars.solar.d - 1];
        let vJ = Sel2.vJ - 0, vW = Sel2.vW - 0;
        if(ob){
            simpleLunarVars.SM_rise_set = getRTSInfo(ob.d0, vJ, vW, curTZ);//日月升降计算
            simpleLunarVars.lunar2.w = simpleLunarVars.lunar.w = simpleLunarVars.solar.w = (ob.week + 1) % 7;
            simpleLunarVars.lunar.y = ob.Lyear4 - 2698;
            simpleLunarVars.lunar.m = SSQ.ym.indexOf(ob.Lmc) - 1;
            if(simpleLunarVars.lunar.m < 1){
                simpleLunarVars.lunar.m += 12;
            }
            simpleLunarVars.lunar2.d = simpleLunarVars.lunar.d = ob.Ldi + 1;
            simpleLunarVars.lunar2.l = simpleLunarVars.lunar.l = (ob.Lleap != '');
            simpleLunarVars.solar.y = Ayear2year(ob.y);
            simpleLunarVars.solar.m = ob.m;
            simpleLunarVars.solar.d = ob.d;
            simpleLunarVars.lunar2.y = 1984+ob.Lyear;
            simpleLunarVars.lunar2.m = (ob.Lmonth - 1) % 12;
            if(simpleLunarVars.lunar2.m < 1){
                simpleLunarVars.lunar2.m += 12;
            }
            simpleLunarVars.lunar.h = simpleLunarVars.lunar2.h = simpleLunarVars.solar.h;
            simpleLunarVars.gan.y = (simpleLunarVars.lunar.y - 4) % 10;
            simpleLunarVars.zhi.y = (simpleLunarVars.lunar.y - 4) % 12;
            simpleLunarVars.gan2.y = (simpleLunarVars.lunar2.y - 4) % 10;
            simpleLunarVars.zhi2.y = (simpleLunarVars.lunar2.y - 4) % 12;
            simpleLunarVars.gan2.m = ob.Lmonth%10;
            simpleLunarVars.zhi2.m = ob.Lmonth%12;
            let mx = simpleLunarVars.lunar.m - simpleLunarVars.lunar2.m;
            if(mx < 0) mx += 12;
            simpleLunarVars.gan.m = (ob.Lmonth + mx) % 10;
            simpleLunarVars.zhi.m = (ob.Lmonth + mx) % 12;
            let jr2 = ob.Lday2.split("");
            simpleLunarVars.gan.d = simpleLunarVars.gan2.d = HeavenlyStems.indexOf(jr2[0]);
            simpleLunarVars.zhi.d = simpleLunarVars.zhi2.d = EarthlyBranches.indexOf(jr2[1]);
            if(simpleLunarVars.solar.h !== null){
                simpleLunarVars.zhi2.h = simpleLunarVars.zhi.h = EarthlyBranches.indexOf(simpleLunarVars.solar.h);
                simpleLunarVars.gan2.h = simpleLunarVars.gan.h = (simpleLunarVars.gan.d * 12 + simpleLunarVars.zhi.h) % 10;
            }
        }
    }
    return retv;
}